﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;

namespace BPC.Magic8Ball
{
    public class SharePoint
    {

        public List<string> GetAnswersFromList(string ListName)
        {
            List<String> answers = new List<string>();

            SPList list = SPContext.Current.Web.Lists[ListName];

            foreach (SPListItem item in list.Items)
            {
                answers.Add(item.Title);
            }
            
            return answers;
        }
    }
}
